const Mock = require('mockjs')

const contracts = Mock.mock({
  'items|10': [{
    id: '@id',
    contractName: '@sentence(3)',
    timestamp: '@datetime',
    contractType: 1
  }]
})

module.exports = [
  // contract list
  {
    url: '/contracts',
    type: 'get',
    response: config => {
      const items = contracts.items
      return {
        code: 200,
        data: {
          total: contracts.items.length,
          items: items
        }
      }
    }
  }
]
